﻿using DLL;
using NursingFormSystem.Common;
using NursingFormSystem.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NursingFormSystem.NursingSurgery
{
    public partial class AddSurgery : Form
    {
        #region 变量声明
        NursingFormSystem.NurFormsService.NursingForm formService = new NursingFormSystem.NurFormsService.NursingForm();
        NursingFormRecord record = new NursingFormRecord();
        string Id;
        PatientInfo PatientInfo;
        Tb_User LoginUser;
        #endregion
        public AddSurgery(Tb_User loginUser, PatientInfo patientInfo, string id)
        {
            InitializeComponent();
            LoginUser = loginUser;
            PatientInfo = patientInfo;
            this.Id = id;
            BindInfo(id);
        }
        public AddSurgery(string[] loginUser, string[] patientInfo)
        {
            InitializeComponent();
            LoginUser = ArrayToObject.ArrayToLoginUser(loginUser);
            PatientInfo = ArrayToObject.ArrayToPatientInfo(patientInfo);
            this.Id = string.Empty;
            BindInfo(this.Id);
        }
        public AddSurgery(string[] loginUser, string[] patientInfo, string id)
        {
            InitializeComponent();
            LoginUser = ArrayToObject.ArrayToLoginUser(loginUser);
            PatientInfo = ArrayToObject.ArrayToPatientInfo(patientInfo);
            this.Id = id;
            BindInfo(id);
        }

        private void BindInfo(string id)
        {
            txtJiaoBanHushi.EditValue = LoginUser.UserName;
            dateriqi.DateTime = DateTime.Now;   //显示当前日期
            if (string.IsNullOrEmpty(id)) return;
            string sql = string.Format("SELECT TOP 1 NursingFormData FROM NursingFormRecord(NOLOCK) WHERE Id='{0}'", Id);
            DataTable tab = SqlHelper.ExecuteDataset(sql, System.Data.CommandType.Text).Tables[0];
            var NursingFormData = Convert.ToString(tab.Rows[0]["NursingFormData"]);
            OperationNote cc = new OperationNote();
            cc = XmlUtil.XMLToObject<OperationNote>(NursingFormData, Encoding.UTF8);
            //cc loding
            if (!string.IsNullOrEmpty(cc.RiQi))
                dateriqi.DateTime = Convert.ToDateTime(cc.RiQi);
            txtopName.Text = cc.NiShouShuMingCheng;
            rdoCaozuoqianHeath.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianJianKangJiaoYu) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianJianKangJiaoYu);
            rdoYishi.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.YiShi) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.YiShi);
            rdowandai.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.WanDai) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.WanDai);
            rdoYaowuguomin.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMin) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMin);
            txtYaowuGuominVal.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMinWenBenKuang;
            rdoPifuzhunbei.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuZhunBei) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuZhunBei);
            rdoJiaochapeixue.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoChaPeiXue) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoChaPeiXue);
            chkPifuqingk1.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang.Split('#')[0].Equals("1");
            chkPifuqingk2.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang.Split('#')[1].Equals("1");
            chkPifuqingk3.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang.Split('#')[2].Equals("1");
            txtBuwei.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuangBuWei;
            rdoTengtong.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.TengTong) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.TengTong);
            txtTengtongBw.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.TengTongBuWei;
            txtTengTongFen.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.TengTongFenZhi;
            txtTiwen.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengTiWen;
            txtMaibo.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengMaiBo;
            txtHuxi.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengHuXi;
            txtXueya1.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengXueYa1;
            txtXueya2.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengXueYa2;
            txtTizhong.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengTiZhong;
            chkJingmtlu1.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[0].Equals("1");
            chkJingmtlu2.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[1].Equals("1");
            chkJingmtlu3.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[2].Equals("1");
            chkJingmtlu4.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[3].Equals("1");
            chkJingmtlu5.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu.Split('#')[4].Equals("1");
            txtJingmaitlbwei.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLuBuWei;
            rdoLiuzdnguan.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiDaoNiaoGuan) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiDaoNiaoGuan);
            rdoLiuzwguan.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiWeiGuan) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiWeiGuan);
            tdoYinliuGuan.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuan) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuan);
            txtYinliuGuanMc.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuanMingCheng;
            rdoCaozuoqianbiaoji.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianBiaoJi) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianBiaoJi);
            rdoCaozuoqianyongyao.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianYongYao) ? "-1" : cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianYongYao);
            txtDairuyaowu.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuYaoWu;
            chkDairuwupin1.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[0].Equals("1");
            chkDairuwupin2.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[1].Equals("1");
            chkDairuwupin3.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[2].Equals("1");
            chkDairuwupin4.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[3].Equals("1");
            chkDairuwupin5.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[4].Equals("1");
            chkDairuwupin6.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin.Split('#')[5].Equals("1");
            txtDairuwupinQta.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPinQiTa;
            txtJiaojieshijian.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoJieShiJian;
            txtJiaoBanHushi.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoBanHuShi;
            txtJiebanhushi.Text = cc.CaoZuoQianZhunBeiYuJiaoJie.JieBanHuShi;
            chkRaoxingjizhen.Checked = cc.CaoZuoQianZhunBeiYuJiaoJie.RaoXingJiZhen.Equals("1");
            rdoZhenjingtongyshu.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.ZhenJingZhiQing) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.ZhenJingZhiQing);
            rdoZhenjingyongyao.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.ZhenJingYongYao) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.ZhenJingYongYao);
            rdoZhiqingtongyishu.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.ZhiQingTongYiShu) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.ZhiQingTongYiShu);
            rdoCaozuoqianjiuxu.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.CaoZuoQianZhunBeiJiuXu) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.CaoZuoQianZhunBeiJiuXu);
            rdoJiuxuYaopin.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.SuoXuYaoPin) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.SuoXuYaoPin);
            rdoTeshuhaocai.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.TeShuHaoCai) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.TeShuHaoCai);
            rdoXiangjianMc.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.MingCheng) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.MingCheng);
            rdoShenfenhedui.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiHeDui.BingRenShenFenShiBieHeDui) ? "-1" : cc.CaoZuoQianZhunBeiHeDui.BingRenShenFenShiBieHeDui);
            rdoBingrenxingm.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZanTingHeDui.BingRenXingMing) ? "-1" : cc.CaoZuoQianZanTingHeDui.BingRenXingMing);
            rdoZhuyuanhao.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZanTingHeDui.ZhuYuanHao) ? "-1" : cc.CaoZuoQianZanTingHeDui.ZhuYuanHao);
            rdoCaozuomczhengq.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZanTingHeDui.CaoZuoMingCheng) ? "-1" : cc.CaoZuoQianZanTingHeDui.CaoZuoMingCheng);
            rdoShoushubuwei.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoQianZanTingHeDui.ShouShuBuWei) ? "-1" : cc.CaoZuoQianZanTingHeDui.ShouShuBuWei);
            txtCaozuobuweiMc.Text = cc.CaoZuoQianZanTingHeDui.CaoZuoBuWei;
            chkCaozuotiwei1.Checked = cc.CaoZuoQianZanTingHeDui.CaoZuoTiWei.Split('#')[0].Equals("1");
            chkCaozuotiwei2.Checked = cc.CaoZuoQianZanTingHeDui.CaoZuoTiWei.Split('#')[1].Equals("1");
            chkCaozuotiwei3.Checked = cc.CaoZuoQianZanTingHeDui.CaoZuoTiWei.Split('#')[2].Equals("1");
            txtCaozuotiwei.Text = cc.CaoZuoQianZanTingHeDui.CaoZuoTiWeiWenBenKuang;
            txtCzqztKaishiSj.Text = cc.CaoZuoQianZanTingHeDui.CaoZuoKaiShiShiJian;
            txtZtingYishi.Text = cc.CaoZuoQianZhunBeiHeDui.YiShi;
            txtZtmazui.Text = cc.CaoZuoQianZhunBeiHeDui.MaZui;
            txtZtHushi.Text = cc.CaoZuoQianZhunBeiHeDui.HuShi;
            chkzaoyingji1.Checked = cc.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[0].Equals("1");
            chkzaoyingji2.Checked = cc.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[1].Equals("1");
            chkzaoyingji3.Checked = cc.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[2].Equals("1");
            chkzaoyingji4.Checked = cc.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[3].Equals("1");
            chkzaoyingji5.Checked = cc.CaoZuoZhongGuanChaJiLu.ZaoYingJi.Split('#')[4].Equals("1");
            txtZaoYingJiVal.Text = cc.CaoZuoZhongGuanChaJiLu.ZaoYingJiQiTa;
            txtcaozuozhongt1.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian1;
            txtcaozuozhongt2.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian2;
            txtcaozuozhongt3.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian3;
            txtcaozuozhongt4.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian4;
            txtcaozuozhongt5.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian5;
            txtcaozuozhongt6.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian6;
            txtcaozuozhongt7.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian7;
            txtcaozuozhongt8.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian8;
            txtcaozuozhongt9.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJian9;
            txtCaozuozXueYa1.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa1;
            txtCaozuozXueYa2.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa2;
            txtCaozuozXueYa3.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa3;
            txtCaozuozXueYa4.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa4;
            txtCaozuozXueYa5.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa5;
            txtCaozuozXueYa6.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa6;
            txtCaozuozXueYa7.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa7;
            txtCaozuozXueYa8.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa8;
            txtCaozuozXueYa9.Text = cc.CaoZuoZhongGuanChaJiLu.XueYa9;
            txtXinlv1.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv1;
            txtXinlv2.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv2;
            txtXinlv3.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv3;
            txtXinlv4.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv4;
            txtXinlv5.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv5;
            txtXinlv6.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv6;
            txtXinlv7.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv7;
            txtXinlv8.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv8;
            txtXinlv9.Text = cc.CaoZuoZhongGuanChaJiLu.XinLv9;
            txtHuxi1.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi1;
            txtHuxi2.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi2;
            txtHuxi3.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi3;
            txtHuxi4.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi4;
            txtHuxi5.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi5;
            txtHuxi6.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi6;
            txtHuxi7.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi7;
            txtHuxi8.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi8;
            txtHuxi9.Text = cc.CaoZuoZhongGuanChaJiLu.HuXi9;
            txtCaozuozhongyyao.Text = cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongYongYao;
            txtBingqingjilu.Text = cc.CaoZuoZhongGuanChaJiLu.BingQingJiLu;
            txtCaozuozhongHushi.Text = cc.CaoZuoZhongGuanChaJiLu.BingQingJiLuHuShi;
            txtCaozuojieshuSj.Text = cc.CaoZuoZhongGuanChaJiLu.CaoZuoJieShuShiJian;
            rdoCaozuozhongbiaoben.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBen) ? "-1" : cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBen);
            txtLiuzhibiaoben.Text = cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBenGeShu;
            txtShijshoushuMc.Text = cc.CaoZuoZhongGuanChaJiLu.ShiJiShouShuMingCheng;
            txtLishiqianjianchasj.Text = cc.CaoZuoZhongGuanChaJiLu.ZhiXingShiJian;
            rdoIsShuxieFangshi.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoZhongGuanChaJiLu.YiShuXie) ? "-1" : cc.CaoZuoZhongGuanChaJiLu.YiShuXie);
            rdoYiqingdian.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoZhongGuanChaJiLu.YiQingDian) ? "-1" : cc.CaoZuoZhongGuanChaJiLu.YiQingDian);
            rdoIsBiaoqian.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoZhongGuanChaJiLu.QueRenShouShu) ? "-1" : cc.CaoZuoZhongGuanChaJiLu.QueRenShouShu);
            rdoJianchaShebei.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoZhongGuanChaJiLu.JianChaSheBei) ? "-1" : cc.CaoZuoZhongGuanChaJiLu.JianChaSheBei);
            txtJianchaYishi.Text = cc.CaoZuoZhongGuanChaJiLu.YiShi;
            txtJianchaMazui.Text = cc.CaoZuoZhongGuanChaJiLu.MaZui;
            txtJianchaHushi.Text = cc.CaoZuoZhongGuanChaJiLu.HuShi;
            chkCaozuozhongfangshi1.Checked = cc.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi.Split('#')[0].Equals("1");
            chkCaozuozhongfangshi2.Checked = cc.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi.Split('#')[1].Equals("1");
            chkCaozuozhongfangshi3.Checked = cc.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi.Split('#')[2].Equals("1");


            chkYishiZhuangtai1.Checked = cc.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[0].Equals("1");
            chkYishiZhuangtai2.Checked = cc.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[1].Equals("1");
            chkYishiZhuangtai3.Checked = cc.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[2].Equals("1");
            chkYishiZhuangtai4.Checked = cc.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[3].Equals("1");
            if (!string.IsNullOrEmpty(cc.CaoZuoHouJiaoJie.YiShiZhuangTai) && cc.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#').Length == 5)
                chkYishiZhuangtai5.Checked = cc.CaoZuoHouJiaoJie.YiShiZhuangTai.Split('#')[4].Equals("1");

            txtPifuqingk1.Checked = cc.CaoZuoHouJiaoJie.PiFuQingKuang.Split('#')[0].Equals("1");
            txtPifuqingk2.Checked = cc.CaoZuoHouJiaoJie.PiFuQingKuang.Split('#')[1].Equals("1");
            txtPifuqingk3.Checked = cc.CaoZuoHouJiaoJie.PiFuQingKuang.Split('#')[2].Equals("1");
            txtPifuqkbuwei.Text = cc.CaoZuoHouJiaoJie.PiFuQingKuangBuWei;
            chkJingmaitonglu1.Checked = cc.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[0].Equals("1");
            chkJingmaitonglu2.Checked = cc.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[1].Equals("1");
            chkJingmaitonglu3.Checked = cc.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[2].Equals("1");
            chkJingmaitonglu4.Checked = cc.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[3].Equals("1");
            chkJingmaitonglu5.Checked = cc.CaoZuoHouJiaoJie.JingMaiTongLu.Split('#')[4].Equals("1");
            txtJingmaitongluBuwei.Text = cc.CaoZuoHouJiaoJie.JingMaiTongLuBuWei;
            rdoCaozuozhongYinliuGuan.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan) ? "-1" : cc.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan);
            txtCaozuozhongyinliugweizhi.Text = cc.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuanWeiZhi;
            txtcaozuohouMaibo.Text = cc.CaoZuoHouJiaoJie.ShengMingTiZhengMaiBo;
            txtCaozuohouHuxi.Text = cc.CaoZuoHouJiaoJie.ShengMingTiZhengHuXi;
            txtCaozuohouXueya1.Text = cc.CaoZuoHouJiaoJie.ShengMingTiZhengXueYa1;
            txtCaozuohouXueya2.Text = cc.CaoZuoHouJiaoJie.ShengMingTiZhengXueYa2;
            rdocaozuohtengtong.SelectedIndex = Convert.ToInt32(string.IsNullOrEmpty(cc.CaoZuoHouJiaoJie.CaoZuoHouTengTong) ? "-1" : cc.CaoZuoHouJiaoJie.CaoZuoHouTengTong);
            txtczhtengtongbuwei.Text = cc.CaoZuoHouJiaoJie.CaoZuoHouTengTongBuWei;
            txtczhtengtongfen.Text = cc.CaoZuoHouJiaoJie.CaoZuoHouTengTongFenZhi;
            txtDaihuiyaopin.Text = cc.CaoZuoHouJiaoJie.DaiHuiYaoPin;
            chkDaihuiwup1.Checked = cc.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[0].Equals("1");
            chkDaihuiwup2.Checked = cc.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[1].Equals("1");
            chkDaihuiwup3.Checked = cc.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[2].Equals("1");
            chkDaihuiwup4.Checked = cc.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[3].Equals("1");
            chkDaihuiwup5.Checked = cc.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[4].Equals("1");
            chkDaihuiwup6.Checked = cc.CaoZuoHouJiaoJie.DaiHuiWuPin.Split('#')[5].Equals("1");
            txtDaihuiwupQt.Text = cc.CaoZuoHouJiaoJie.DaiHuiWuPinQiTa;
            chkHuanzhequx1.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[0].Equals("1");
            chkHuanzhequx2.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[1].Equals("1");
            chkHuanzhequx3.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[2].Equals("1");
            chkHuanzhequx4.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[3].Equals("1");
            chkHuanzhequx5.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[4].Equals("1");
            chkHuanzhequx6.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[5].Equals("1");
            chkHuanzhequx7.Checked = cc.CaoZuoHouJiaoJie.HuanZheQuXiang.Split('#')[6].Equals("1");
            txtJiaojieSj.Text = cc.CaoZuoHouJiaoJie.JiaoJieShiJian;
            txtczhJiaobHushi.Text = cc.CaoZuoHouJiaoJie.JiaoBanHuShi;
            txtCzhJieBanHushi.Text = cc.CaoZuoHouJiaoJie.JieBanHuShi;
            txtNaintiechu.Text = cc.CaoZuoHouJiaoJie.TiNeiZhiRuWuHeGeZhengZhanTieChu;

            if (string.IsNullOrEmpty(cc.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi))
                cc.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi = "0#0#0";
            checkMaZuiHuiFuShi_YunZhuan_CheChuang.Checked = cc.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi.Split('#')[0].Equals("1");
            checkMaZuiHuiFuShi_YunZhuan_LunYi.Checked = cc.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi.Split('#')[1].Equals("1");
            checkMaZuiHuiFuShi_YunZhuan_BuXing.Checked = cc.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi.Split('#')[2].Equals("1");

            if (string.IsNullOrEmpty(cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai))
                cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai = "0#0#0#0#0";
            checkMaZuiHuiFuShi_YiShiZhuangTai_QingXing.Checked = cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[0].Equals("1");
            checkMaZuiHuiFuShi_YiShiZhuangTai_ShiShui.Checked = cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[1].Equals("1");
            checkMaZuiHuiFuShi_YiShiZhuangTai_QianHunMi.Checked = cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[2].Equals("1");
            checkMaZuiHuiFuShi_YiShiZhuangTai_ShenHunMi.Checked = cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[3].Equals("1");
            checkMaZuiHuiFuShi_YiShiZhuangTai_MaZuiWeiXing.Checked = cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai.Split('#')[4].Equals("1");

            if (string.IsNullOrEmpty(cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuang))
                cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuang = "0#0#0";
            checkMaZuiHuiFuShi_PiFuQingKuang_WanHao.Checked = cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuang.Split('#')[0].Equals("1");
            checkMaZuiHuiFuShi_PiFuQingKuang_YaHong.Checked = cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuang.Split('#')[1].Equals("1");
            checkMaZuiHuiFuShi_PiFuQingKuang_PoKui.Checked = cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuang.Split('#')[2].Equals("1");

            checkMaZuiHuiFuShi_PiFuQingKuang_BuWei.Text = cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuangBuWei;

            if (string.IsNullOrEmpty(cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu))
                cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu = "0#0#0#0#0";
            checkMaZuiHuiFuShi_JingMaiTongLu_WaiZhouJingMaiChuanCi.Checked = cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[0].Equals("1");
            checkMaZuiHuiFuShi_JingMaiTongLu_CVC.Checked = cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[1].Equals("1");
            checkMaZuiHuiFuShi_JingMaiTongLu_PICC.Checked = cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[2].Equals("1");
            checkMaZuiHuiFuShi_JingMaiTongLu_ShuYeGang.Checked = cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[3].Equals("1");
            checkMaZuiHuiFuShi_JingMaiTongLu_Wu.Checked = cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu.Split('#')[4].Equals("1");

            checkMaZuiHuiFuShi_JingMaiTongLu_BuWei.Text = cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLuBuWei;
            radioCaoZuoZhongLiuZhiYinLiuGuan.EditValue = cc.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan;
            MaZuiHuiFuShi_CaoZuoZhongLiuZhiYinLiuGuan_TeXt.Text = cc.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuanWeiZhi;

            textMaZuiHuiFuShi_ShengMingTiZheng_MaiBo.Text = cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengMaiBo;
            textMaZuiHuiFuShi_ShengMingTiZheng_HuXi.Text = cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengHuXi;
            textMaZuiHuiFuShi_ShengMingTiZheng_XueYa_1.Text = cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengXueYa1;
            textMaZuiHuiFuShi_ShengMingTiZheng_XueYa_2.Text = cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengXueYa2;
            textMaZuiHuiFuShi_TengTongPingFen_FenZhi.Text = cc.MaZuiHuiFuShiJiaoJie.TengTongFenZhi;
            textMaZuiHuiFuShi_DaiHuiYaoPin_Text.Text = cc.MaZuiHuiFuShiJiaoJie.DaiHuiYaoPin;

            if (string.IsNullOrEmpty(cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin))
                cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin = "0#0#0#0#0#0";
            checkMaZuiHuiFuShi_DaiHuiWuPin1.Checked = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[0].Equals("1");
            checkMaZuiHuiFuShi_DaiHuiWuPin2.Checked = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[1].Equals("1");
            checkMaZuiHuiFuShi_DaiHuiWuPin3.Checked = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[2].Equals("1");
            checkMaZuiHuiFuShi_DaiHuiWuPin4.Checked = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[3].Equals("1");
            checkMaZuiHuiFuShi_DaiHuiWuPin5.Checked = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[4].Equals("1");
            checkMaZuiHuiFuShi_DaiHuiWuPin6.Checked = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin.Split('#')[5].Equals("1");

            textMaZuiHuiFuShi_QiTa_Text.Text = cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPinQiTa;

            if (string.IsNullOrEmpty(cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang) || cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#').Length != 7)
                cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang = "0#0#0#0#0#0#0";
            checkMaZuiHuiFuShi_HuanZheQuXiang1.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[0].Equals("1");
            checkMaZuiHuiFuShi_HuanZheQuXiang2.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[1].Equals("1");
            checkMaZuiHuiFuShi_HuanZheQuXiang3.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[2].Equals("1");
            checkMaZuiHuiFuShi_HuanZheQuXiang4.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[3].Equals("1");
            checkMaZuiHuiFuShi_HuanZheQuXiang5.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[4].Equals("1");
            checkMaZuiHuiFuShi_HuanZheQuXiang6.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[5].Equals("1");
            checkMaZuiHuiFuShi_HuanZheQuXiang7.Checked = cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang.Split('#')[6].Equals("1");

            date_MaZuiHuiFuShi_JiaoJieShiJian.Text = cc.MaZuiHuiFuShiJiaoJie.JiaoJieShiJian;
            text_MaZuiHuiFuShi_JiaoJieHuShi.Text = cc.MaZuiHuiFuShiJiaoJie.JiaoBanHuShi;
            text_MaZuiHuiFuShi_JieBanHuShi.Text = cc.MaZuiHuiFuShiJiaoJie.JieBanHuShi;
        }

        #region 保存
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(dateriqi.Text))
                dateriqi.DateTime = DateTime.Now;

            OperationNote cc = new OperationNote();
            //cc doing...
            cc.RiQi = dateriqi.DateTime.ToString("yyyy-MM-dd");
            cc.FormId = (int)(FormType.SheetSafeChkRecord);
            cc.FormName = EnumHelper.GetDescription(FormType.SheetSafeChkRecord);
            cc.ShiJian = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            cc.NiShouShuMingCheng = txtopName.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianJianKangJiaoYu = rdoCaozuoqianHeath.EditValue == null ? "-1" : rdoCaozuoqianHeath.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.YiShi = rdoYishi.EditValue == null ? "-1" : rdoYishi.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.WanDai = rdowandai.EditValue == null ? "-1" : rdowandai.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMin = rdoYaowuguomin.EditValue == null ? "-1" : rdoYaowuguomin.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.YaoWuGuoMinWenBenKuang = txtYaowuGuominVal.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuZhunBei = rdoPifuzhunbei.EditValue == null ? "-1" : rdoPifuzhunbei.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoChaPeiXue = rdoJiaochapeixue.EditValue == null ? "-1" : rdoJiaochapeixue.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuang =
                (chkPifuqingk1.Checked ? "1" : "0") + "#" +
                (chkPifuqingk2.Checked ? "1" : "0") + "#" +
                (chkPifuqingk3.Checked ? "1" : "0");
            cc.CaoZuoQianZhunBeiYuJiaoJie.PiFuQingKuangBuWei = txtBuwei.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.TengTong = rdoTengtong.EditValue == null ? "-1" : rdoTengtong.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.TengTongBuWei = txtTengtongBw.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.TengTongFenZhi = txtTengTongFen.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengTiWen = txtTiwen.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengMaiBo = txtMaibo.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengHuXi = txtHuxi.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengXueYa1 = txtXueya1.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengXueYa2 = txtXueya2.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.ShengMingTiZhengTiZhong = txtTizhong.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLu =
                (chkJingmtlu1.Checked ? "1" : "0") + "#" +
                (chkJingmtlu2.Checked ? "1" : "0") + "#" +
                (chkJingmtlu3.Checked ? "1" : "0") + "#" +
                (chkJingmtlu4.Checked ? "1" : "0") + "#" +
                (chkJingmtlu5.Checked ? "1" : "0");
            cc.CaoZuoQianZhunBeiYuJiaoJie.JingMaiTongLuBuWei = txtJingmaitlbwei.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiDaoNiaoGuan = rdoLiuzdnguan.EditValue == null ? "-1" : rdoLiuzdnguan.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.LiuZhiWeiGuan = rdoLiuzwguan.EditValue == null ? "-1" : rdoLiuzwguan.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuan = tdoYinliuGuan.EditValue == null ? "-1" : tdoYinliuGuan.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.YinLiuGuanMingCheng = txtYinliuGuanMc.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianBiaoJi = rdoCaozuoqianbiaoji.EditValue == null ? "-1" : rdoCaozuoqianbiaoji.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.CaoZuoQianYongYao = rdoCaozuoqianyongyao.EditValue == null ? "-1" : rdoCaozuoqianyongyao.EditValue.ToString();
            cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuYaoWu = txtDairuyaowu.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPin =
                (chkDairuwupin1.Checked ? "1" : "0") + "#" +
                (chkDairuwupin2.Checked ? "1" : "0") + "#" +
                (chkDairuwupin3.Checked ? "1" : "0") + "#" +
                (chkDairuwupin4.Checked ? "1" : "0") + "#" +
                (chkDairuwupin5.Checked ? "1" : "0") + "#" +
                (chkDairuwupin6.Checked ? "1" : "0");
            cc.CaoZuoQianZhunBeiYuJiaoJie.DaiRuWuPinQiTa = txtDairuwupinQta.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoJieShiJian = txtJiaojieshijian.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoBanHuShi = txtJiaoBanHushi.Text;
            if (string.IsNullOrEmpty(this.Id) && string.IsNullOrEmpty(cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoBanHuShi))
                cc.CaoZuoQianZhunBeiYuJiaoJie.JiaoBanHuShi = LoginUser.UserName;

            cc.CaoZuoQianZhunBeiYuJiaoJie.JieBanHuShi = txtJiebanhushi.Text;
            cc.CaoZuoQianZhunBeiYuJiaoJie.RaoXingJiZhen = chkRaoxingjizhen.Checked ? "1" : "0";

            cc.CaoZuoQianZhunBeiHeDui.ZhenJingZhiQing = rdoZhenjingtongyshu.EditValue == null ? "-1" : rdoZhenjingtongyshu.EditValue.ToString();
            cc.CaoZuoQianZhunBeiHeDui.ZhenJingYongYao = rdoZhenjingyongyao.EditValue == null ? "-1" : rdoZhenjingyongyao.EditValue.ToString();
            cc.CaoZuoQianZhunBeiHeDui.ZhiQingTongYiShu = rdoZhiqingtongyishu.EditValue == null ? "-1" : rdoZhiqingtongyishu.EditValue.ToString();
            cc.CaoZuoQianZhunBeiHeDui.CaoZuoQianZhunBeiJiuXu = rdoCaozuoqianjiuxu.EditValue == null ? "-1" : rdoCaozuoqianjiuxu.EditValue.ToString();
            cc.CaoZuoQianZhunBeiHeDui.SuoXuYaoPin = rdoJiuxuYaopin.EditValue == null ? "-1" : rdoJiuxuYaopin.EditValue.ToString();

            rdoTeshuhaocai.EditValue = rdoTeshuhaocai.EditValue == null ? "-1" : rdoTeshuhaocai.EditValue.ToString();
            rdoXiangjianMc.EditValue = rdoXiangjianMc.EditValue == null ? "-1" : rdoXiangjianMc.EditValue.ToString();
            cc.CaoZuoQianZhunBeiHeDui.TeShuHaoCai = (rdoTeshuhaocai.EditValue == null ? "-1" : rdoTeshuhaocai.EditValue.ToString());
            cc.CaoZuoQianZhunBeiHeDui.MingCheng = (rdoXiangjianMc.EditValue == null ? "-1" : rdoXiangjianMc.EditValue.ToString());
            cc.CaoZuoQianZhunBeiHeDui.BingRenShenFenShiBieHeDui = rdoShenfenhedui.EditValue == null ? "-1" : rdoShenfenhedui.EditValue.ToString();
            cc.CaoZuoQianZanTingHeDui.BingRenXingMing = rdoBingrenxingm.EditValue == null ? "-1" : rdoBingrenxingm.EditValue.ToString();
            cc.CaoZuoQianZanTingHeDui.ZhuYuanHao = rdoZhuyuanhao.EditValue == null ? "-1" : rdoZhuyuanhao.EditValue.ToString();
            cc.CaoZuoQianZanTingHeDui.CaoZuoMingCheng = rdoCaozuomczhengq.EditValue == null ? "-1" : rdoCaozuomczhengq.EditValue.ToString();
            cc.CaoZuoQianZanTingHeDui.ShouShuBuWei = rdoShoushubuwei.EditValue == null ? "-1" : rdoShoushubuwei.EditValue.ToString();
            cc.CaoZuoQianZanTingHeDui.CaoZuoBuWei = txtCaozuobuweiMc.Text;
            cc.CaoZuoQianZanTingHeDui.CaoZuoTiWei =
                (chkCaozuotiwei1.Checked ? "1" : "0") + "#" +
                (chkCaozuotiwei2.Checked ? "1" : "0") + "#" +
                (chkCaozuotiwei3.Checked ? "1" : "0");
            cc.CaoZuoQianZanTingHeDui.CaoZuoTiWeiWenBenKuang = txtCaozuotiwei.Text;

            cc.CaoZuoQianZanTingHeDui.CaoZuoKaiShiShiJian = txtCzqztKaishiSj.Text;

            cc.CaoZuoQianZhunBeiHeDui.YiShi = txtZtingYishi.Text;
            cc.CaoZuoQianZhunBeiHeDui.MaZui = txtZtmazui.Text;
            cc.CaoZuoQianZhunBeiHeDui.HuShi = txtZtHushi.Text;

            cc.CaoZuoZhongGuanChaJiLu.ZaoYingJi =
                (chkzaoyingji1.Checked ? "1" : "0") + "#" +
                (chkzaoyingji2.Checked ? "1" : "0") + "#" +
                (chkzaoyingji3.Checked ? "1" : "0") + "#" +
                (chkzaoyingji4.Checked ? "1" : "0") + "#" +
                (chkzaoyingji5.Checked ? "1" : "0");
            cc.CaoZuoZhongGuanChaJiLu.ZaoYingJiQiTa = txtZaoYingJiVal.Text;

            cc.CaoZuoZhongGuanChaJiLu.ShiJian1 = txtcaozuozhongt1.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian2 = txtcaozuozhongt2.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian3 = txtcaozuozhongt3.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian4 = txtcaozuozhongt4.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian5 = txtcaozuozhongt5.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian6 = txtcaozuozhongt6.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian7 = txtcaozuozhongt7.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian8 = txtcaozuozhongt8.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJian9 = txtcaozuozhongt9.Text;

            cc.CaoZuoZhongGuanChaJiLu.XueYa1 = txtCaozuozXueYa1.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa2 = txtCaozuozXueYa2.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa3 = txtCaozuozXueYa3.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa4 = txtCaozuozXueYa4.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa5 = txtCaozuozXueYa5.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa6 = txtCaozuozXueYa6.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa7 = txtCaozuozXueYa7.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa8 = txtCaozuozXueYa8.Text;
            cc.CaoZuoZhongGuanChaJiLu.XueYa9 = txtCaozuozXueYa9.Text;

            cc.CaoZuoZhongGuanChaJiLu.XinLv1 = txtXinlv1.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv2 = txtXinlv2.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv3 = txtXinlv3.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv4 = txtXinlv4.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv5 = txtXinlv5.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv6 = txtXinlv6.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv7 = txtXinlv7.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv8 = txtXinlv8.Text;
            cc.CaoZuoZhongGuanChaJiLu.XinLv9 = txtXinlv9.Text;

            cc.CaoZuoZhongGuanChaJiLu.HuXi1 = txtHuxi1.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi2 = txtHuxi2.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi3 = txtHuxi3.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi4 = txtHuxi4.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi5 = txtHuxi5.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi6 = txtHuxi6.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi7 = txtHuxi7.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi8 = txtHuxi8.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuXi9 = txtHuxi9.Text;
            cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongYongYao = txtCaozuozhongyyao.Text;
            cc.CaoZuoZhongGuanChaJiLu.BingQingJiLu = txtBingqingjilu.Text;
            cc.CaoZuoZhongGuanChaJiLu.BingQingJiLuHuShi = txtCaozuozhongHushi.Text;
            cc.CaoZuoZhongGuanChaJiLu.CaoZuoJieShuShiJian = txtCaozuojieshuSj.Text;
            cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBen = rdoCaozuozhongbiaoben.EditValue == null ? "-1" : rdoCaozuozhongbiaoben.EditValue.ToString();
            cc.CaoZuoZhongGuanChaJiLu.CaoZuoZhongLiuZhiBiaoBenGeShu = txtLiuzhibiaoben.Text;
            cc.CaoZuoZhongGuanChaJiLu.ShiJiShouShuMingCheng = txtShijshoushuMc.Text;
            cc.CaoZuoZhongGuanChaJiLu.ZhiXingShiJian = txtLishiqianjianchasj.Text;
            cc.CaoZuoZhongGuanChaJiLu.YiShuXie = rdoIsShuxieFangshi.EditValue == null ? "-1" : rdoIsShuxieFangshi.EditValue.ToString();
            cc.CaoZuoZhongGuanChaJiLu.YiQingDian = rdoYiqingdian.EditValue == null ? "-1" : rdoYiqingdian.EditValue.ToString();
            cc.CaoZuoZhongGuanChaJiLu.QueRenShouShu = rdoIsBiaoqian.EditValue == null ? "-1" : rdoIsBiaoqian.EditValue.ToString();
            cc.CaoZuoZhongGuanChaJiLu.JianChaSheBei = rdoJianchaShebei.EditValue == null ? "-1" : rdoJianchaShebei.EditValue.ToString();
            cc.CaoZuoZhongGuanChaJiLu.YiShi = txtJianchaYishi.Text;
            cc.CaoZuoZhongGuanChaJiLu.MaZui = txtJianchaMazui.Text;
            cc.CaoZuoZhongGuanChaJiLu.HuShi = txtJianchaHushi.Text;

            cc.CaoZuoHouJiaoJie.CaoZuoZhongYunZhuanFangShi =
                (chkCaozuozhongfangshi1.Checked ? "1" : "0") + "#" +
                (chkCaozuozhongfangshi2.Checked ? "1" : "0") + "#" +
                (chkCaozuozhongfangshi3.Checked ? "1" : "0");
            cc.CaoZuoHouJiaoJie.YiShiZhuangTai =
                (chkYishiZhuangtai1.Checked ? "1" : "0") + "#" +
                (chkYishiZhuangtai2.Checked ? "1" : "0") + "#" +
                (chkYishiZhuangtai3.Checked ? "1" : "0") + "#" +
                (chkYishiZhuangtai4.Checked ? "1" : "0") + "#" +
                (chkYishiZhuangtai5.Checked ? 1 : 0);
            cc.CaoZuoHouJiaoJie.PiFuQingKuang =
                 (txtPifuqingk1.Checked ? "1" : "0") + "#" +
                (txtPifuqingk2.Checked ? "1" : "0") + "#" +
                (txtPifuqingk3.Checked ? "1" : "0");
            cc.CaoZuoHouJiaoJie.PiFuQingKuangBuWei = txtPifuqkbuwei.Text;
            cc.CaoZuoHouJiaoJie.JingMaiTongLu =
                (chkJingmaitonglu1.Checked ? "1" : "0") + "#" +
                (chkJingmaitonglu2.Checked ? "1" : "0") + "#" +
                (chkJingmaitonglu3.Checked ? "1" : "0") + "#" +
                (chkJingmaitonglu4.Checked ? "1" : "0") + "#" +
                (chkJingmaitonglu5.Checked ? "1" : "0");
            cc.CaoZuoHouJiaoJie.JingMaiTongLuBuWei = txtJingmaitongluBuwei.Text;
            cc.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan = rdoCaozuozhongYinliuGuan.EditValue == null ? "-1" : rdoCaozuozhongYinliuGuan.EditValue.ToString();
            cc.CaoZuoHouJiaoJie.CaoZuoZhongLiuZhiYinLiuGuanWeiZhi = txtCaozuozhongyinliugweizhi.Text;
            cc.CaoZuoHouJiaoJie.ShengMingTiZhengMaiBo = txtcaozuohouMaibo.Text;
            cc.CaoZuoHouJiaoJie.ShengMingTiZhengHuXi = txtCaozuohouHuxi.Text;
            cc.CaoZuoHouJiaoJie.ShengMingTiZhengXueYa1 = txtCaozuohouXueya1.Text;
            cc.CaoZuoHouJiaoJie.ShengMingTiZhengXueYa2 = txtCaozuohouXueya2.Text;
            cc.CaoZuoHouJiaoJie.CaoZuoHouTengTong = rdocaozuohtengtong.EditValue == null ? "-1" : rdocaozuohtengtong.EditValue.ToString();
            cc.CaoZuoHouJiaoJie.CaoZuoHouTengTongBuWei = txtczhtengtongbuwei.Text;
            cc.CaoZuoHouJiaoJie.CaoZuoHouTengTongFenZhi = txtczhtengtongfen.Text;
            cc.CaoZuoHouJiaoJie.DaiHuiYaoPin = txtDaihuiyaopin.Text;
            cc.CaoZuoHouJiaoJie.DaiHuiWuPin =
                (chkDaihuiwup1.Checked ? "1" : "0") + "#" +
                (chkDaihuiwup2.Checked ? "1" : "0") + "#" +
                (chkDaihuiwup3.Checked ? "1" : "0") + "#" +
                (chkDaihuiwup4.Checked ? "1" : "0") + "#" +
                (chkDaihuiwup5.Checked ? "1" : "0") + "#" +
                (chkDaihuiwup6.Checked ? "1" : "0");
            cc.CaoZuoHouJiaoJie.DaiHuiWuPinQiTa = txtDaihuiwupQt.Text;
            cc.CaoZuoHouJiaoJie.HuanZheQuXiang =
                (chkHuanzhequx1.Checked ? "1" : "0") + "#" +
                (chkHuanzhequx2.Checked ? "1" : "0") + "#" +
                (chkHuanzhequx3.Checked ? "1" : "0") + "#" +
                (chkHuanzhequx4.Checked ? "1" : "0") + "#" +
                (chkHuanzhequx5.Checked ? "1" : "0") + "#" +
                (chkHuanzhequx6.Checked ? "1" : "0") + "#" +
                (chkHuanzhequx7.Checked ? "1" : "0");
            cc.CaoZuoHouJiaoJie.JiaoJieShiJian = txtJiaojieSj.Text;
            cc.CaoZuoHouJiaoJie.JiaoBanHuShi = txtczhJiaobHushi.Text;
            cc.CaoZuoHouJiaoJie.JieBanHuShi = txtCzhJieBanHushi.Text;
            cc.CaoZuoHouJiaoJie.TiNeiZhiRuWuHeGeZhengZhanTieChu = txtNaintiechu.Text;
            cc.MaZuiHuiFuShiJiaoJie.YunZhuanFangShi =
                (checkMaZuiHuiFuShi_YunZhuan_CheChuang.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_YunZhuan_LunYi.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_YunZhuan_BuXing.Checked ? 1 : 0);

            cc.MaZuiHuiFuShiJiaoJie.YiShiZhuangTai =
                (checkMaZuiHuiFuShi_YiShiZhuangTai_QingXing.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_YiShiZhuangTai_ShiShui.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_YiShiZhuangTai_QianHunMi.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_YiShiZhuangTai_ShenHunMi.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_YiShiZhuangTai_MaZuiWeiXing.Checked ? 1 : 0);

            cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuang =
                (checkMaZuiHuiFuShi_PiFuQingKuang_WanHao.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_PiFuQingKuang_YaHong.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_PiFuQingKuang_PoKui.Checked ? 1 : 0);

            cc.MaZuiHuiFuShiJiaoJie.PiFuQingKuangBuWei = checkMaZuiHuiFuShi_PiFuQingKuang_BuWei.Text;
            cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLu =
                (checkMaZuiHuiFuShi_JingMaiTongLu_WaiZhouJingMaiChuanCi.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_JingMaiTongLu_CVC.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_JingMaiTongLu_PICC.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_JingMaiTongLu_ShuYeGang.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_JingMaiTongLu_Wu.Checked ? 1 : 0);
            cc.MaZuiHuiFuShiJiaoJie.JingMaiTongLuBuWei = checkMaZuiHuiFuShi_JingMaiTongLu_BuWei.Text;
            cc.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuan = radioCaoZuoZhongLiuZhiYinLiuGuan.Text.ToString();
            cc.MaZuiHuiFuShiJiaoJie.CaoZuoZhongLiuZhiYinLiuGuanWeiZhi = MaZuiHuiFuShi_CaoZuoZhongLiuZhiYinLiuGuan_TeXt.Text;

            cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengMaiBo = textMaZuiHuiFuShi_ShengMingTiZheng_MaiBo.Text;
            cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengHuXi = textMaZuiHuiFuShi_ShengMingTiZheng_HuXi.Text;
            cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengXueYa1 = textMaZuiHuiFuShi_ShengMingTiZheng_XueYa_1.Text;
            cc.MaZuiHuiFuShiJiaoJie.ShengMingTiZhengXueYa2 = textMaZuiHuiFuShi_ShengMingTiZheng_XueYa_2.Text;
            cc.MaZuiHuiFuShiJiaoJie.TengTongFenZhi = textMaZuiHuiFuShi_TengTongPingFen_FenZhi.Text;
            cc.MaZuiHuiFuShiJiaoJie.DaiHuiYaoPin = textMaZuiHuiFuShi_DaiHuiYaoPin_Text.Text;

            cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPin =
                (checkMaZuiHuiFuShi_DaiHuiWuPin1.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_DaiHuiWuPin2.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_DaiHuiWuPin3.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_DaiHuiWuPin4.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_DaiHuiWuPin5.Checked ? 1 : 0) + "#" +
                (checkMaZuiHuiFuShi_DaiHuiWuPin6.Checked ? 1 : 0);

            cc.MaZuiHuiFuShiJiaoJie.DaiHuiWuPinQiTa = textMaZuiHuiFuShi_QiTa_Text.Text;

            cc.MaZuiHuiFuShiJiaoJie.HuanZheQuXiang =
                (checkMaZuiHuiFuShi_HuanZheQuXiang1.Checked ? 1 : 0) + "#" +
            (checkMaZuiHuiFuShi_HuanZheQuXiang2.Checked ? 1 : 0) + "#" +
            (checkMaZuiHuiFuShi_HuanZheQuXiang3.Checked ? 1 : 0) + "#" +
            (checkMaZuiHuiFuShi_HuanZheQuXiang4.Checked ? 1 : 0) + "#" +
            (checkMaZuiHuiFuShi_HuanZheQuXiang5.Checked ? 1 : 0) + "#" +
            (checkMaZuiHuiFuShi_HuanZheQuXiang6.Checked ? 1 : 0) + "#" +
            (checkMaZuiHuiFuShi_HuanZheQuXiang7.Checked ? 1 : 0);

            cc.MaZuiHuiFuShiJiaoJie.JiaoJieShiJian = date_MaZuiHuiFuShi_JiaoJieShiJian.Text;
            cc.MaZuiHuiFuShiJiaoJie.JiaoBanHuShi = text_MaZuiHuiFuShi_JiaoJieHuShi.Text;
            cc.MaZuiHuiFuShiJiaoJie.JieBanHuShi = text_MaZuiHuiFuShi_JieBanHuShi.Text;

            record.NursingFormData = XmlUtil.ObjectToXML(cc, Encoding.UTF8);
            record.FormId = cc.FormId;//表单ID
            record.FormName = cc.FormName;//表单NAME
            record.PatientId = PatientInfo.PATIENT_ID;//住院号
            record.VisitId = PatientInfo.VISIT_ID;//住院次数
            record.PatientName = PatientInfo.PATIENT_NAME;//患者名称
            record.BedNo = PatientInfo.BED_NO;//床号
            record.DepartmentId = PatientInfo.DEPARTMENT_ID;//科室号
            record.DepartmentName = PatientInfo.DEPARTMENT_NAME;//科室名称
            record.AreaId = PatientInfo.NURSE_CELL_CODE;//病区编号
            record.AreaName = PatientInfo.NURSE_CELL_NAME;//病区名称
            record.AssessmentDate = dateriqi.DateTime;
            record.Id = string.IsNullOrEmpty(Id) ? 0 : Convert.ToInt32(Id);
            var ret = formService.SetNursingFormRecord(Newtonsoft.Json.JsonConvert.SerializeObject(record));
            if (ret.Code == 1)
            {
                MessageBox.Show(ret.M);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(ret.M);
            }
        }
        #endregion

        #region 取消
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }
        #endregion

        #region 操作中观察记录的时间 双击显示当前时间
        private void txtcaozuozhongt1_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt1.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt2_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt3_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt3.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt4_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt4.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt5_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt5.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt6_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt6.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt7_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt7.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt8_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt8.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        private void txtcaozuozhongt9_DoubleClick(object sender, EventArgs e)
        {
            this.txtcaozuozhongt9.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }


        void txtLishiqianjianchasj_DoubleClick(object sender, EventArgs e)
        {
            txtLishiqianjianchasj.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        void txtJiaojieSj_DoubleClick(object sender, EventArgs e)
        {
            txtJiaojieSj.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        void txtCaozuojieshuSj_DoubleClick(object sender, EventArgs e)
        {
            txtCaozuojieshuSj.DateTime = DateTime.Now;
            txtCaozuojieshuSj.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        void txtJiaojieshijian_DoubleClick(object sender, EventArgs e)
        {
            txtJiaojieshijian.DateTime = DateTime.Now;
            txtJiaojieshijian.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }

        void txtCzqztKaishiSj_DoubleClick(object sender, EventArgs e)
        {
            txtCzqztKaishiSj.DateTime = DateTime.Now;
            txtCzqztKaishiSj.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }
        void date_MaZuiHuiFuShi_JiaoJieShiJian_DoubleClick(object sender, EventArgs e)
        {
            date_MaZuiHuiFuShi_JiaoJieShiJian.DateTime = DateTime.Now;
            date_MaZuiHuiFuShi_JiaoJieShiJian.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }
        #endregion

        /// <summary>
        /// 设置 enter键当做Tab切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EnterTab_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                SendKeys.SendWait("{Tab}");
            }
        }

    }
}
